package com.lyc.day1103.demo02;

/**
 * @author ：Xiaochen
 * @date ：Created in 2022/11/3 20:13
 * @description：
 * @modified By：
 * @version:
 */
public class Test {
    public static void main(String[] args) {
        Swimming s = new Swimming() {
            @Override
            public void swiming() {
                System.out.println("------匿名内部类");
            }
        };
        fun(s);

        Swimming s1=()->{
            System.out.println("lambda表达式==============");
        };
        fun(s1);
    }
    public static void fun(Swimming s){
        s.swiming();
    }
}

@FunctionalInterface
interface Swimming{
    public void swiming();
}